import service from '@/utils/crmRequest'

export default () => ({

  // 获取目标接口--列表
  TARGETMANAGE_TARGET_LIST: (data) => {
    return service({
      url: '/api/target/list',
      method: 'post',
      data
    })
  },

  // 获取目标接口--删除列表
  TARGETMANAGE_TARGET_DELETE_LIST: (id) => {
    return service({
      url: `/api/target/delete?id=${id}`,
      method: 'delete',
    })
  },

  // 获取目标接口--详情接口
  TARGETMANAGE_TARGET_DETAIL: (params) => {
    return service({
      url: '/api/target/detail',
      method: 'get',
      params
    })
  },

  // 获取目标接口--详情接口copy
  TARGETMANAGE_TARGET_DETAIL_COPY: (params) => {
    return service({
      url: '/api/target/copy-detail',
      method: 'get',
      params
    })
  },

  // 创建目标接口
  TARGETMANAGE_TARGET_CREATE: (data) => {
    return service({
      url: '/api/target/create',
      method: 'post',
      data
    })
  },

  // 更换目标接口
  TARGETMANAGE_TARGET_UPDADE: (data) => {
    return service({
      url: '/api/target/update',
      method: 'put',
      data
    })
  },

  // 更换目标接口copy
  TARGETMANAGE_TARGET_UPDADE_COPY: (data) => {
    return service({
      url: '/api/target/copy-update',
      method: 'put',
      data
    })
  },

  // 获取考核模板接口
  TARGETMANAGE_TARGET_OBTAIN: (data) => {
    return service({
      url: '/api/inspectionTemplate/list',
      method: 'post',
      data
    })
  },

  // 获取客户列表
  TARGETMANAGE_CUSTOMER_LIST_BY_TYPE: (data) => {
    return service({
      url: '/api/target/get-customer-list',
      method: 'post',
      data
    })
  },

  // 获取产品线和产品信
  TARGETMANAGE_PRODUCT: () => {
    return service({
      url: '/api/sysProductLine/list-products',
      method: 'get',
    })
  },

  // 获取目标下产品列表
  TARGETMANAGE_PRODUCT_LIST: (data) => {
    return service({
      url: '/api/target/product-list',
      method: 'post',
      donNotShowLoading: true,
      data
    })
  },

  // 获取目标下客户列表
  TARGETMANAGE_CUSTOMER_LIST: (params) => {
    return service({
      url: '/api/target/customer-list',
      method: 'get',
      donNotShowLoading: true,
      params
    })
  },

  // 统计图表---获取财年下拉列表
  TARGETMANAGE_YEAR_LIST: (data) => {
    return service({
      url: 'api/target/fiscal',
      method: 'post',
      data
    })
  },

  // 统计图表---获取目标下拉列表
  TARGETMANAGE_TARGET_DOWN_LIST: (data) => {
    return service({
      url: 'api/target/down',
      method: 'post',
      data
    })
  },

  // 统计图表---产品线下拉列表
  TARGETMANAGE_SCOPE_LIST: (params) => {
    return service({
      url: 'api/target/scope',
      method: 'get',
      params
    })
  },

  // 统计图表
  TARGETMANAGE_CHART_COMMON1: (data) => {
    return service({
      url: '/api/targetAnalysis/info',
      method: 'post',
      data
    })
  },

  // 统计图表
  TARGETMANAGE_CHART_COMMON2: (data) => {
    return service({
      url: '/api/targetAnalysis/three-table/info',
      method: 'post',
      data
    })
  },

  // 获取目标历史列表
  TARGETMANAGE_HISTORY_LIST: (id) => {
    return service({
      url: '/api/targetHistory/list?targetId=' + id,
      method: 'get',
    })
  },

  // 获取目标历史详情
  TARGETMANAGE_HISTORY_DETAIL: (id) => {
    return service({
      url: '/api/targetHistory/detail?id=' + id,
      method: 'get',
    })
  },

  // 获取编辑目标值
  TARGETMANAGE_SCOPE_DETAIL: (params) => {
    return service({
      url: '/api/target/scope-detail',
      method: 'get',
      params
    })
  },

  // 获取编辑目标值copy
  TARGETMANAGE_SCOPE_DETAIL_COPY: (params) => {
    return service({
      url: '/api/target/copy-scope-detail',
      method: 'get',
      params
    })
  },

  // 更新目标值
  TARGETMANAGE_UPDATE_VALUE: (data) => {
    return service({
      url: '/api/target/update-value',
      method: 'put',
      data
    })
  },

  // 更新目标值copy
  TARGETMANAGE_UPDATE_VALUE_COPY: (data) => {
    return service({
      url: '/api/target/copy-update-value',
      method: 'put',
      data
    })
  },

  // 提交审核copy
  TARGETMANAGE_JUST_SUBMIT_COPY: (params) => {
    return service({
      url: '/api/target/adjust-submit',
      method: 'put',
      params
    })
  },

  // 提交审核
  TARGETMANAGE_JUST_SUBMIT: (params) => {
    return service({
      url: '/api/target/submit',
      method: 'put',
      params
    })
  },

  //跟新统计数据
  TARGET_CKECK_TOTAL : () => {
    return service({
      url:'/api/targetAnalysis/update/finish-value',
      method: 'get',
    })
  },

})
